home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
misc
/
football
/
exec
/
alt_results.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-29
|
7KB
|
239 lines
/* ***********************************************************************
RESULTS PROGRAM FOR FOOTBALL REXX SUITE
---------------------------------------
Copyright Mark Naughton 1996
Version Date History
--------------------------------------------------------------------------
1.0 270996 First release. Displays all results from 'Teams.sf'
file.
1.1 121196 Updated to get arguments and to use '*.sflearn' to get
a true display as '.sf' was in order. Now called as a
component of FOOTBALL.
131196 Added checks for files - if not found, exits without
a message.
211196 Updated and tidied the display.
190497 Added title to display.
1.2 060997 Amended to handle new Automatic Scheduling schedules.
Removed - new program for this. Formatting needs to be
handled properly.
151297 Tidied display.
180499 Improved match/fixture display.
310599 Changed to accommodate extra data in '.sflearn' file.
1.3 280699 Added and changed code to run the same as the alternative
displays for League, to display goal scorers, bookings,
substitutes, referees and attendances.
250899 Added error msg to file check.
270899 Converted to use locale. Some error messages, before
reading the locale, will still be in English.
290899 Added support for Yellow-then-Red cards.
**************************************************************************
Procedure
---------
1. Check files exist.
2. Open file and print all lines without '*' with the exception of
the league name which is underlined. Build table of player information
and match information then display.
3. Close file and exit.
************************************************************************** */
PARSE ARG league_file
version = 1
league_file = "Data/" || league_file
input_file = '.sflearn'
separator = '*'
separator2 = '**'
home. = '???'
hct = 0
away. = '???'
act = 0
hmkr = -1
amkr = -1
if open(datafile,"Data/Football.locale",'r') then do
line = readln(datafile)
locdir = strip(line)
close(datafile)
end
else do
say
say "ERROR : (Results)"
say
say "Cannot read 'Data/Football.locale' for the locale settings."
exit
end
locdir = locdir"Exec/Alt_Results.data"
if open(datafile,"ENV:FootballRXPath",'r') then do
line = readln(datafile)
rxdir = strip(line)
close(datafile)
end
else
rxdir = "SYS:Rexxc/"
if exists(locdir) > 0 then do
address command rxdir'rx 'locdir
VarCount = getclip('VarCount')
do i = 1 to VarCount
interpret getclip('var.'i)
end
end
else do
say
say "ERROR : (Results)"
say
say "Cannot find '"locdir"' to read locale settings."
exit
end
if exists(league_file || input_file) = 0 then do
say
say ar_error
say
say ar_one"'"league_file||input_file"'."
exit
end
spaces = left(" ",30,' ')
do i=1 to 99
home.i = spaces
away.i = spaces
end
referee = ""
attend = ""
if open(datafile,league_file || input_file,'r') then do
say
say center(ar_two,78)
say "-------------------------------------------------------------------------------"
say
do while ~eof(datafile)
line = readln(datafile)
if pos(separator,line) = 0 then do
if act = 0 & hct = 0 then do
say
say
say
end
if act > 0 | hct > 0 then do
if hct > act then
mloop = hct
else
mloop = act
say
do ii=1 to mloop
t2 = home.ii
t3 = away.ii
say left(strip(t2),30,' ')" "left(strip(t3),30,' ')
home.ii = spaces
away.ii = spaces
end
say
if referee ~= "" then
say ar_three""referee
if attend ~= "" then
say ar_four""attend
referee = ""
attend = ""
say
say
say
act = 0
hct = 0
end
say line
end
else do
if pos(separator2,line) > 0 then do
say subword(line,2)
uline = ''
do i=1 to length(subword(line,2))
uline = insert('-',uline,i,1)
end
say strip(uline)
say
end
else do
if pos("*ATD=",line) > 0 then
attend = delstr(line,1,5)
if pos("*RF=",line) > 0 then
referee = delstr(line,1,4)
if pos("*HG=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)
if pos("(P)",home.hct) > 0 then do
lk = pos("(P)",home.hct)
home.hct = overlay("(pen)",home.hct,lk,5)
end
end
if pos("*AG=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)
if pos("(P)",away.act) > 0 then do
lk = pos("(P)",away.act)
away.act = overlay("(pen)",away.act,lk,5)
end
end
if pos("*HY=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)" "ar_five
end
if pos("*AY=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)" "ar_five
end
if pos("*HYR=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,5)" "ar_six
end
if pos("*AYR=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,5)" "ar_six
end
if pos("*HR=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)" "ar_seven
end
if pos("*AR=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)" "ar_seven
end
if pos("*HS=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)" "ar_eight
end
if pos("*AS=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)" "ar_eight
end
if pos("*HM=",line) > 0 then do
hct = hct + 1
home.hct = ar_nine""delstr(line,1,4)
end
if pos("*AM=",line) > 0 then do
act = act + 1
away.act = ar_nine""delstr(line,1,4)
end
end
end
end
say "-------------------------------------------------------------------------------"
close(datafile)
end
else do
say
say "ERROR : (Results)"
say
say ar_ten"'"league_file||input_file"'"ar_eleven
end
exit